<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改劳动合同')" />
    <th:block th:include="include :: datetimepicker-css" />
    <style>
        .salary {
            position: relative;
            min-height: 1px;
            padding-right: 0px;
            padding-left: 0px;
            width: 16.66666667%;
            float: left;
        }
        .salary > label.error {
            margin-top: 12px;
        }
    </style>

</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-contract-edit" >
            <input name="id" th:value="${salaryStructureNew.id}" type="hidden">
            <div class="wrapper wrapper-content animated fadeInRight ibox-content" th:object="${salaryStructure}">

                <input name="id" th:field="*{id}" type="hidden">
                <div class="form-group col-sm-12">
                    <h3>现薪资结构</h3>
                </div>

                <div class="form-group col-sm-12">
                    <label class="col-sm-3 control-label is-required">员工：</label>
                    <div class="col-sm-8">
                        <input name="empName" th:field="*{empName}" class="form-control" maxlength="10" type="text" readonly>
                    </div>
                </div>

                <div class="form-group col-sm-12">
                    <label class="col-sm-3 control-label">现薪资调整时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            <input name="adjustDate" th:value="${#dates.format(salaryStructure.adjustDate, 'yyyy-MM-dd')}"   class="form-control" placeholder="yyyy-MM-dd" readonly="readonly" type="text"  disabled>
                        </div>
                    </div>
                </div>

                <div class="form-group col-sm-12">
                    <label class="col-sm-3 control-label is-required">薪酬等级：</label>
                    <div class="col-sm-8">
                        <input name="payGrade" th:field="*{payGrade}" class="form-control" maxlength="10" type="text" readonly>
                    </div>
                </div>
                <div class="form-group col-sm-12" style="width: 90%;margin-left: 12%;">
                    <div class="col-sm-2 salary">
                        <label class=" control-label is-required">当月固定工资：</label>
                        <input name="comprehensive" th:field="*{comprehensive}" class="form-control" type="text" maxlength="10" readonly>
                    </div>

                    <div class="col-sm-2 salary">
                        <label class=" control-label is-required">基本工资：</label>
                        <input name="basic" th:field="*{basic}" class="form-control salaryAdd"  type="text" maxlength="10"  readonly>
                    </div>

                    <div class="col-sm-2 salary">
                        <label class=" control-label is-required">加班费：</label>
                        <input name="overtimePay" th:field="*{overtimePay}" class="form-control salaryAdd"  type="text" maxlength="10"  readonly>
                    </div>

                    <div class="col-sm-2 salary">
                        <label class=" control-label is-required">绩效工资基数：</label>
                        <input name="performanceBonus" th:field="*{performanceBonus}" class="form-control salaryAdd"  type="text" maxlength="10"  readonly>
                    </div>

                    <div class="col-sm-2 salary">
                        <label class=" control-label is-required">岗位补贴：</label>
                        <input name="allowance" th:field="*{allowance}" class="form-control salaryAdd"  type="text" maxlength="10"  readonly>
                    </div>

                    <div class="col-sm-2 salary">
                        <label class=" control-label is-required">其他补贴：</label>
                        <input name="otherSubsidies" th:field="*{otherSubsidies}" class="form-control salaryAdd"  type="text" maxlength="10"  readonly>
                    </div>
<!--
                    <div class="col-sm-2 salary">
                        <label class=" control-label is-required">伙食补贴：</label>
                        <input name="foodAllowance" th:field="*{foodAllowance}" class="form-control salaryAdd"  type="number" maxlength="10"  readonly>
                    </div>

                    <div class="col-sm-2 salary">
                        <label class=" control-label is-required">住宿补贴：</label>
                        <input name="accommodationSubsidy" th:field="*{accommodationSubsidy}" class="form-control salaryAdd"  type="number" maxlength="10"  readonly>
                    </div>

                    <div class="col-sm-2 salary">
                        <label class=" control-label is-required">高温补贴：</label>
                        <input name="highSubsidy" th:field="*{highSubsidy}" class="form-control salaryAdd"  type="number" maxlength="10"  readonly>
                    </div>

                    <div class="col-sm-2 salary">
                        <label class=" control-label is-required">加班补贴：</label>
                        <input name="overtimeAllowance" th:field="*{overtimeAllowance}" class="form-control salaryAdd"  type="number" maxlength="10"  readonly>
                    </div>

                    <div class="col-sm-2 salary">
                        <label class=" control-label is-required">夜班补贴：</label>
                        <input name="nightAllowance" th:field="*{nightAllowance}" class="form-control salaryAdd"  type="number" maxlength="10" readonly>
                    </div>

                    <div class="col-sm-2 salary">
                        <label class=" control-label is-required">全勤奖：</label>
                        <input name="attendanceBonus" th:field="*{attendanceBonus}" class="form-control salaryAdd"  type="number" maxlength="10"  readonly>
                    </div>-->
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label ">调薪情况：</label>
                    <div class="col-sm-8">
                        <textarea name="salaryContent"  th:field="*{salaryContent}" class="form-control"  ></textarea>
                    </div>
                </div>
            </div>
            <div class="wrapper wrapper-content animated fadeInRight ibox-content" th:object="${salaryStructureNew}" >
                    <div class="form-group col-sm-12">
                        <h3>调整薪资结构</h3>
                    </div>

                <div class="form-group col-sm-12">
                    <label class="col-sm-3 control-label is-required">员工：</label>
                    <div class="col-sm-8">
                        <input name="empName" th:field="*{empName}" class="form-control" maxlength="10" type="text" readonly>
                    </div>
                </div>

                    <div class="form-group col-sm-12">
                        <label class="col-sm-3 control-label is-required">本次薪资调整时间：</label>
                        <div class="col-sm-8">
                            <div class="input-group date">
                                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                <input name="adjustDate"  th:value="${#dates.format(salaryStructureNew.adjustDate, 'yyyy-MM-dd')}"   class="form-control" placeholder="yyyy-MM-dd" readonly="readonly" type="text" required>
                            </div>
                        </div>
                    </div>


                <div class="form-group col-sm-12">
                    <label class="col-sm-3 control-label is-required">薪酬等级：</label>
                    <div class="col-sm-8">
                        <input name="payGrade" th:field="*{payGrade}" class="form-control" maxlength="10" type="text" readonly>
                    </div>
                </div>

                    <div class="form-group col-sm-12" style="width: 90%;margin-left: 12%;">
                        <div class="col-sm-2 salary">
                            <label class=" control-label is-required">当月固定工资：</label>
                            <input name="comprehensive" th:field="*{comprehensive}" class="form-control" type="text" maxlength="10" readonly>
                        </div>

                        <div class="col-sm-2 salary">
                            <label class=" control-label is-required">基本工资：</label>
                            <input name="basic" th:field="*{basic}" class="form-control salaryAdd"  type="text" maxlength="10"  readonly>
                        </div>

                        <div class="col-sm-2 salary">
                            <label class=" control-label is-required">加班费：</label>
                            <input name="overtimePay" th:field="*{overtimePay}" class="form-control salaryAdd"  type="text" maxlength="10"  readonly>
                        </div>

                        <div class="col-sm-2 salary">
                            <label class=" control-label is-required">绩效工资基数：</label>
                            <input name="performanceBonus" th:field="*{performanceBonus}" class="form-control salaryAdd"  type="text" maxlength="10"  readonly>
                        </div>

                        <div class="col-sm-2 salary">
                            <label class=" control-label is-required">岗位补贴：</label>
                            <input name="allowance" th:field="*{allowance}" class="form-control salaryAdd"  type="text" maxlength="10"  readonly>
                        </div>

                        <div class="col-sm-2 salary">
                            <label class=" control-label is-required">其他补贴：</label>
                            <input name="otherSubsidies" th:field="*{otherSubsidies}" class="form-control salaryAdd"  type="text" maxlength="10"  readonly>
                        </div>

                        <!--<div class="col-sm-2 salary">
                            <label class=" control-label is-required">伙食补贴：</label>
                            <input name="foodAllowance" th:field="*{foodAllowance}" class="form-control salaryAdd"  type="number" maxlength="10"  readonly>
                        </div>

                        <div class="col-sm-2 salary">
                            <label class=" control-label is-required">住宿补贴：</label>
                            <input name="accommodationSubsidy" th:field="*{accommodationSubsidy}" class="form-control salaryAdd"  type="number" maxlength="10"  readonly>
                        </div>

                        <div class="col-sm-2 salary">
                            <label class=" control-label is-required">高温补贴：</label>
                            <input name="highSubsidy" th:field="*{highSubsidy}" class="form-control salaryAdd"  type="number" maxlength="10"  readonly>
                        </div>

                        <div class="col-sm-2 salary">
                            <label class=" control-label is-required">加班补贴：</label>
                            <input name="overtimeAllowance" th:field="*{overtimeAllowance}" class="form-control salaryAdd"  type="number" maxlength="10"  readonly>
                        </div>

                        <div class="col-sm-2 salary">
                            <label class=" control-label is-required">夜班补贴：</label>
                            <input name="nightAllowance" th:field="*{nightAllowance}" class="form-control salaryAdd"  type="number" maxlength="10" readonly>
                        </div>

                        <div class="col-sm-2 salary">
                            <label class=" control-label is-required">全勤奖：</label>
                            <input name="attendanceBonus" th:field="*{attendanceBonus}" class="form-control salaryAdd"  type="number" maxlength="10"  readonly>
                        </div>-->
                    </div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label ">调薪情况：</label>
                        <div class="col-sm-8">
                            <textarea name="salaryContent"  th:field="*{salaryContent}" class="form-control"  ></textarea>
                        </div>
                    </div>
            </div>
            <hr />
            <div class="form-group taskItem">
                <label class="col-sm-3 control-label" for="hrApproved">审批意见：</label>
                <div class="col-sm-8">
                    <select name="p_B_approved" id="hrApproved" class="form-control m-b" required>
                        <option value="true">同意</option>
                        <option value="false">拒绝</option>
                    </select>
                </div>
            </div>
            <div class="form-group taskItem">
                <a href="#comment" id="maodian"><span id="mo2g"><span></a>
                <label class="col-sm-3 control-label">批注：</label>
                <div class="col-sm-8">
                    <textarea name="comment" class="form-control" ></textarea>
                </div>
            </div>
        </form>
    </div>

    <div class="container-div " style="height: initial;">
        <div class="row">
            <div class="col-sm-12 search-collapse" hidden>
                <form id="role-form">
                    <input type="hidden" id="instanceId" name="instanceId" th:value="${salaryStructureNew.instanceId}">
                    <div class="select-list">
                        <ul>
                            <li>
                                任务名称：<input type="text" name="activityName"/>
                            </li>
                            <li>
                                办理人ID：<input type="text" name="assignee"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('role-form' , 'bootstrap-table' )"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('role-form' , 'bootstrap-table')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="col-sm-12 select-table ">
                <table id="bootstrap-table" ></table>
            </div>
        </div>
    </div>
    
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "hr/salaryStructure";
        $("#form-contract-edit").validate({
            focusCleanup: true
        });

        for (var i = 0; i < document.getElementsByTagName("input").length; i++) {
            var inputDocument = document.getElementsByTagName("input")[i];
            if (inputDocument.name != 'id'){
                inputDocument.disabled = true;
            }
        }
        for (var i = 0; i < document.getElementsByTagName("textarea").length; i++) {
            var textareaDocument = document.getElementsByTagName("textarea")[i];
            if (textareaDocument.name != 'comment'){
                textareaDocument.disabled = true;
            }
        }
        for (var i = 0; i < document.getElementsByTagName("select").length; i++) {
            var selectDocument = document.getElementsByTagName("select")[i];
            if (selectDocument.name != 'p_B_approved'){
                selectDocument.disabled = true;
            }
        }

        function submitHandler() {
            $('#mo2g').click();
            if ($.validate.form()) {
                var taskId = [[${taskId}]];
                $.operate.save(prefix + "/complete/" + taskId, $('#form-contract-edit').serialize());
            }
        }

        $(function () {
            
            //审批意见
            debugger
            $.common.openTaskCommens($("#instanceId").val(),'role-form');
        });

    </script>
</body>

</html>